package jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class JDBCDemo4 {
    public static void main(String[] args) {

        try(Connection connection=DBUtil.getConnection()){
            Statement statement = connection.createStatement();

            String sql="delete from userinfo where id=1";
            int i = statement.executeUpdate(sql);
            if (i>0){
                System.out.println("删除成功");
            } else if (i<0) {
                System.out.println("删除失败");
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }


    }
}
